package  
{
        
        import com.adobe.flex.extras.controls.springgraph.IEdgeRenderer;
        import mx.core.UIComponent;
        import com.adobe.flex.extras.controls.springgraph.Graph;
        import flash.display.Graphics;
         
        public class WallEdge implements IEdgeRenderer
        {
                private var rc:int = -1;
                
                public function WallEdge() {
                        
                }
                
                public function draw(g:Graphics, fromView:UIComponent, toView:UIComponent, fromX:int, fromY:int, toX:int, toY:int, graph:Graph):Boolean {
                        
                        var col:Array = new Array(5);
                        col[0] = 0xd2232a;
                        col[1] = 0x41ad49;
                        col[2] = 0x526bb3
                        col[3] = 0x00b1eb;
                        col[4] = 0xdffdd00;
                        
                        if (rc == -1) {
                                rc = Math.round(Math.random() * 4);
                        }
                        var v:PaxView = fromView as PaxView;
                        var rc:int = v.getColorIdx();
                        
                        g.lineStyle(Wall.getInstance().thicknessSlider.value,col[rc],1);
                        g.beginFill(0);
                        g.moveTo(fromX, fromY);
                        g.lineTo(toX, toY);
                        g.endFill();
                        
                        return true;
                }
                
        }

}